﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations; 


namespace Addressbook
{
    public class Person
    {
        //[Key]
        public int Id { get; private set; }
        public string Firstname { get; private set; }
        public string Lastname { get; private set; }
        private int age;
        public int Age
        {
            get { return age; }
            set
            {
                if (value > 150)
                {
                    //MessageBox.Show("no way dude!");
                    System.Diagnostics.Debug.Print("no way dude!");
                }
                else
                {
                    age = value;
                }
            }
        }
        public List<Address> AddressList { get; private set; }

        //Person() {}

        public Person(int id, string firstname, string lastname, List<Address> addresslist) {
            Id = id;
            Firstname = firstname;
            Lastname = lastname;
            AddressList = addresslist;
        }
    }
}
